package com.fg.cloud.common.construction;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;

/**
 * 树形菜单通用vo对象，存在上下级关系，本级当前对象，下级为child，上下级对应关系通过上级 id ==> 下级pid
 * @author around
 * @date 2017-6-16
 */
public class Tree implements java.io.Serializable {
	
	private static final long serialVersionUID = -8729453051122170992L;

	/** ID */
	private Long id;
	
	/** 上级id */
    private Long pid;
    
    private String number;

	/** 菜单名称 */
    private String label;
    
    private String text;
    /** 排序 */
    private int seq;
    
    /** 菜单按钮 */
    private String icon;

    /** URL属性 */
    private String url;
    
    private String permission;
    
    /** 类型，0：主菜单，1：子菜单，2：按钮 */
    private Integer type;
    
	/** 打开关闭状态： open：打开   closed：关闭 */
    private String state = "open";// open,closed
    
    /** 是否可见 */
    private boolean visible = true;

	/** checkbox是否选中 */
    private boolean checked = false;
    
    /** 备注 */
    private String remark;

	/** 子对象集合 */
    private List<Tree> children = Lists.newArrayList();
    
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	public List<Tree> getChildren() {
		return children;
	}

	public void setChildren(List<Tree> children) {
		this.children = children;
	}


	public boolean isVisible() {
		return visible;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public int getSeq() {
		return seq;
	}

	public void setSeq(int seq) {
		this.seq = seq;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
	
	public String getPermission() {
		return permission;
	}

	public void setPermission(String permission) {
		this.permission = permission;
	}
	
	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	@Override
	public String toString() {
		return "Tree [id=" + id + ", pid=" + pid + ", number=" + number + ", label=" + label + ", seq=" + seq
				+ ", icon=" + icon + ", url=" + url + ", permission=" + permission + ", type=" + type + ", state="
				+ state + ", visible=" + visible + ", checked=" + checked + ", children=" + children + "]";
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
}
